package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the CLASS_DY database table.
 * 
 */
@Entity
@Table(name="CLASS_DY")
@NamedQuery(name="ClassDy.findAll", query="SELECT c FROM ClassDy c")
public class ClassDy implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CLASS_DY_CLASSID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CLASS_DY_CLASSID_GENERATOR")
	@Column(name="CLASS_ID")
	private long classId;

	@Column(name="CLASS_CREATORDATE")
	private Timestamp classCreatordate;

	@Column(name="CLASS_DAYS")
	private BigDecimal classDays;

	@Column(name="CLASS_HOUR")
	private BigDecimal classHour;

	@Column(name="CLASS_NAME")
	private String className;

	@Column(name="CLASS_PERSON")
	private String classPerson;

	@Column(name="CLASS_QUALIFIED")
	private BigDecimal classQualified;

	@Column(name="CLASS_REMARK")
	private String classRemark;

	@Column(name="CLASS_SJ_NAME")
	private String classSjName;

	@Column(name="CLASS_STOP")
	private BigDecimal classStop;

	@Column(name="CLASS_TEST")
	private BigDecimal classTest;

	@Column(name="CLASS_UPDATEDATE")
	private Timestamp classUpdatedate;

	//bi-directional many-to-one association to CourseTeam
	@ManyToOne
	@JoinColumn(name="COURT_ID")
	private CourseTeam courseTeam;

	//bi-directional many-to-one association to ExamPaper
	@ManyToOne
	@JoinColumn(name="EP_ID")
	private ExamPaper examPaper;

	//bi-directional many-to-one association to Course
	@OneToMany(mappedBy="classDy")
	@JSONField(serialize=false)
	private List<Course> courses;

	public ClassDy() {
	}

	public long getClassId() {
		return this.classId;
	}

	public void setClassId(long classId) {
		this.classId = classId;
	}

	public Timestamp getClassCreatordate() {
		return this.classCreatordate;
	}

	public void setClassCreatordate(Timestamp classCreatordate) {
		this.classCreatordate = classCreatordate;
	}

	public BigDecimal getClassDays() {
		return this.classDays;
	}

	public void setClassDays(BigDecimal classDays) {
		this.classDays = classDays;
	}

	public BigDecimal getClassHour() {
		return this.classHour;
	}

	public void setClassHour(BigDecimal classHour) {
		this.classHour = classHour;
	}

	public String getClassName() {
		return this.className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public String getClassPerson() {
		return this.classPerson;
	}

	public void setClassPerson(String classPerson) {
		this.classPerson = classPerson;
	}

	public BigDecimal getClassQualified() {
		return this.classQualified;
	}

	public void setClassQualified(BigDecimal classQualified) {
		this.classQualified = classQualified;
	}

	public String getClassRemark() {
		return this.classRemark;
	}

	public void setClassRemark(String classRemark) {
		this.classRemark = classRemark;
	}

	public String getClassSjName() {
		return this.classSjName;
	}

	public void setClassSjName(String classSjName) {
		this.classSjName = classSjName;
	}

	public BigDecimal getClassStop() {
		return this.classStop;
	}

	public void setClassStop(BigDecimal classStop) {
		this.classStop = classStop;
	}

	public BigDecimal getClassTest() {
		return this.classTest;
	}

	public void setClassTest(BigDecimal classTest) {
		this.classTest = classTest;
	}

	public Timestamp getClassUpdatedate() {
		return this.classUpdatedate;
	}

	public void setClassUpdatedate(Timestamp classUpdatedate) {
		this.classUpdatedate = classUpdatedate;
	}

	public CourseTeam getCourseTeam() {
		return this.courseTeam;
	}

	public void setCourseTeam(CourseTeam courseTeam) {
		this.courseTeam = courseTeam;
	}

	public ExamPaper getExamPaper() {
		return this.examPaper;
	}

	public void setExamPaper(ExamPaper examPaper) {
		this.examPaper = examPaper;
	}

	public List<Course> getCourses() {
		return this.courses;
	}

	public void setCourses(List<Course> courses) {
		this.courses = courses;
	}

	public Course addCours(Course cours) {
		getCourses().add(cours);
		cours.setClassDy(this);

		return cours;
	}

	public Course removeCours(Course cours) {
		getCourses().remove(cours);
		cours.setClassDy(null);

		return cours;
	}

}